<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
    <title>APP下载</title>
    <script src="js/jquery.js"></script>
    <script src="js/clipboard.min.js"></script>
    <script type="text/javascript">
        var browser = {
            versions: function () {
                var u = navigator.userAgent, app = navigator.appVersion;
                return { //移动终端浏览器版本信息
                    ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
                    android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端或uc浏览器
                    iPhone: u.indexOf('iPhone') > -1, //是否为iPhone
                    iPad: u.indexOf('iPad') > -1, //是否iPad
                };
            }(),
        }
        if (browser.versions.iPhone || browser.versions.iPad || browser.versions.ios) {
            alert("暂不支持IOS设备安装，请使用Safari浏览器打开使用！");
        } else {
            let ua = navigator.userAgent.toLowerCase();
            if (ua.match(/MicroMessenger/i) == "micromessenger") {

            }else {
                window.location.href = "https://aoluola.cs.yunhoo.net/app/aoluola.apk";
            }
        }
    </script>
    <link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="weixin">
    <div class="logo" style=""><img src="img/logo.png" alt=""></div>
    <div class="text">由于微信内无法下载文件，如需下载，请复制链接后粘贴到浏览器下载<br />https://aoluola.cs.yunhoo.net/app/</div>
    <div class="tj">点击复制链接</div>
    <div class="copyCj">
        <textarea id="foo" value=""></textarea>
        <button class="btn" data-clipboard-target="#foo"></button>
    </div>
    <div class="copyTishi" style='display:none;'>

    </div>
    <div class="tishiBg"></div>
    <script>
        var clipboard = new ClipboardJS('.btn');
        clipboard.on('success', function() {
            $(".copyTishi").html(`<img src="img/success.png" /><p>复制成功</p>`);
            tishi();
        });
        clipboard.on('error', function() {
            $(".copyTishi").html(`<img src="img/error.png" /><p>复制失败 请手动复制</p>`);
            tishi();
        });
        $(".tj").click(function (){
            $('#foo').val('https://aoluola.cs.yunhoo.net/app/aoluola.apk');
            $(".btn").click();
        });
        function tishi() {
            $(".copyTishi").show();
            $(".tishiBg").show();
            setTimeout(function () {
                $(".copyTishi").hide();
                $(".tishiBg").hide();
            },2000);
        }
    </script>
</div>
</body>
</html>